home *** CD-ROM | disk | FTP | other *** search
/ Risc World 5 / Risc World 5.iso / SOFTWARE / Issue3 / MDCalc / ReadMe1st
Text File  |  2004-07-26  |  25KB  |  691 lines

  1.  
  2.   !MFCalc - Multi-Function Calculator  - Martin Carradus - July 2004
  3.   =================================================
  4.  
  5. This is ***PUBLIC DOMAIN*** Software and should NOT be distributed for
  6. any kind of remuneration without contacting the author.
  7.   
  8.   !MFCalc performs numerical calculations on expressions typed into
  9. its Input slot when the 'Calculate' button is clicked upon. The slot
  10. may be cleared out either by typing Control with 'U', or by clicking
  11. on the 'Clear Entry' button.
  12.  
  13. The following can be typed into the 'Input' slot:-
  14.  
  15. Remarks
  16. =======
  17.  
  18. Remarks begin with '/*' and end with '*/', and are totally ignored by
  19. !MFCalc.
  20.  
  21. Numerics
  22. =======
  23.  
  24. These are of Five types:-
  25.  
  26. Integers: e.g. 1234
  27.  
  28. Exponented Integers: e.g. 1234E1 or 1234e+2
  29.  
  30. Hexadecimal constants, which begin with '&', '&h' or '&H': e.g. &H1ab
  31. or &HADD. They are case insensitive.
  32.  
  33. Octal constants, which begin with '&o' or '&O': e.g. &O0137
  34.  
  35. Floating constants: They always have a decimal point in them and can
  36. also be exponented: e.g. .1234 or 1.25 or 2.3456e-6 or 0.001E+5
  37.  
  38. Variables
  39. =======
  40.  
  41. A named storage location containing a numeric value.
  42.  
  43. Always begin with an alpha character or underscore, then continue with
  44. any alphanumeric or underscore. These are case sensitive and become
  45. available with the value zero wherever they are mentioned. Integer
  46. variables end with a '%', otherwise they are taken to be floating
  47. point, unless declared otherwise (see below). They also can be of any
  48. length up to the 256 character limit of the Input slot.
  49.  
  50. Examples: 'a' or 'A%' or '_HELLO' or 'var1%' or 'non_zero'.
  51.  
  52. Assignment of Variables
  53. ==================
  54.  
  55. This is simply done by typing the variables name then '=' then some
  56. numeric expression to the right of that, which in turn may contain
  57. variable names. e.g. num0=1.0 or A%=B%+6 or _hello=_goodbye
  58.  
  59. These statements may optionally be preceded by the key word 'LET', in
  60. upper or lower case.
  61.  
  62. e.g. LET a=0.0 or let no%=2
  63.  
  64. Note that if you assign an integer variable a floating value, then it
  65. will be truncated to an integer.
  66.  
  67. e.g. let a%=-2.5 gives a% the value -2
  68.  
  69. Multiple Assignments
  70. ================
  71.  
  72. Simply concatenate the assignments together with a colon between.
  73.  
  74. Example: a%=b%*6:let c%=a%+4:d=c%^2
  75.  
  76. Operators
  77. =======
  78.  
  79. You have already seen some of these above, they are:-
  80.  
  81. Addition and Subtraction: '+' and '-' e.g. 1+2 or 4.0-2.0
  82.  
  83. You may also negate expressions: e.g. a%=-b%
  84.  
  85. Multiplication and Division: '*' and '/' e.g. 6*7 or 1.0/2.0
  86.  
  87. !MFCalc will complain about division by zero by outputting a comment
  88. if this happens.
  89.  
  90. Integer Division: 'div' or 'DIV', performs the division and then
  91. truncates it to an integer. Also complains about division by zero.
  92.  
  93. e.g. '5.0 div 2.0' gives the value '2'.
  94.  
  95. Modular Arithmetic: 'mod' or 'MOD', gives the remainder upon division.
  96.  
  97. e.g. 5 MOD 2 gives the value '1'. Complains about MOD with respect to
  98. zero.
  99.  
  100. Lastly raising a% to the power b% is denoted by 'a%^b%', and, unlike
  101. the rest binds to the right, so 'a%^b%^c%' is taken as 'a%^(b%^c%)'.
  102.  
  103. So 3^1^2 is 3, not 9.
  104.  
  105. !MFCalc complains about raising zero to a zero or negative power.
  106.  
  107. Also beware of raising negative quantities to fractional powers.
  108.  
  109. As you can see, these expressions may be bracketed, but otherwise the
  110. precedence of these operators is in reverse order to the list above,
  111. going from performing powers at highest precedence, to addition and
  112. subtraction at lowest precedence.
  113.  
  114. In all this, if !MFCalc can't make sense of the input line, it ouputs
  115. a 'Syntax Error' comment.
  116.  
  117. Combinations
  118. ==========
  119.  
  120. The number of ways of picking r objects from n without regard
  121. to the order of the objects is usually denoted by:-
  122.         n
  123.            C
  124.                r
  125.                
  126. The 'combination' of r objects from n.
  127.  
  128. e.g. The number of ways of picking 1 object from 5 is 5,
  129. but the number of ways of picking 2 objects from 5 is 10.
  130.  
  131. The operator in !MFCalc you use is 'NCR' or 'ncr', so
  132.  
  133.   '5 ncr 1' yields a value of 5,
  134.   and '5 ncr 2' yields a value of 10.
  135.  
  136. You may use floating values, but !MFCalc complains if they
  137. have any fractional places. !MFcalc also complains if either
  138. of the values supplied is negative, or if the second value exceeds
  139. the first.
  140.  
  141. If you exceed several hundred for either of the arguments, you will
  142. get a message about 'Stack Overflow', as recursion is employed.
  143.  
  144. Lastly NCR binds the least of all the operators, so all calculations
  145. on both sides are performed first before the combination is taken.
  146.  
  147. e.g. '6-1 ncr 3-1' will give you the value of '5 ncr 2'.
  148.  
  149. NB NCR is not associative, so !MFcalc will error multiple NCRs
  150. in one expression e.g. '12 NCR 2 NCR 2' will cause a syntax error.
  151.  
  152. Minimum and Maximum of Values
  153. ==========================
  154.  
  155. The operators 'MIN' and 'min' or 'MAX' and 'max' between two
  156. expressions give the minimum or maximum of the two values e.g.
  157.  
  158.   '2 min 1' gives a value of 1, but '2 max 1' gives a value of 2
  159.   
  160. These operators bind more tightly than addition or subtraction, but
  161. less than multiplication and division or any higher operator, so,
  162.  
  163.   '2 min 1 + 3 min 2', will give the sum '1 + 2' giving 3,
  164.   but '2*6 min 3*8' will produce '12 min 24', giving 12.
  165.   
  166. Also they are left associative, so combinatons of 'min' and 'max' are
  167. obeyed from left to right e.g.
  168.  
  169.   '2 max 1 min 4' becomes '2 min 4', which becomes 2
  170.  
  171. You will note that you can obtain the minimum or maximum of more than
  172. two values by simply concatenating them between the same operator e.g.
  173.  
  174.     'x% min y% min z%' gives the minimum of x% and y% and z% and
  175.     'x% max y% max z%' gives the maximum of x% and y% and z%.
  176.  
  177. Both 'min' and 'max' attempt to keep the resulting value as an integer
  178. whenever possible e.g.
  179.  
  180.   '2.0 max 4.0' will produce the integer value of '4', not '4.0',
  181.   but '2 max 4.7' will produce the floating value '4.7'
  182.   
  183. Lowest Common Multiple (LCM) and Greatest Common Divisor (GCD)
  184. ====================================================
  185.  
  186. The Greatest Common Divisor of two Numbers is the largest number less
  187. than or equal to them that divides into both numbers exactly.
  188.  
  189. e.g.  '6 gcd 21' gives 3, as 6=3*2 and 21=3*7, so 3 is the largest
  190. common factor. !MFCalc uses a method called 'Euclid's Algorithm' to
  191. obtain this number. If two numbers share no common factor greater than
  192. or equal to two, then their GCD is one. This is true particularly when
  193. both are prime.
  194.  
  195. The Lowest Common Multiple of two numbers is the lowest number that
  196. shares the factors of both numbers.
  197.  
  198. e.g. '6 lcm 21' gives 42=3*2*7, as 6=3*2 and 21=3*7, 42 is the
  199. smallest number that shares the factors of both numbers.
  200.  
  201. Note that that the LCM times the GCD of a and b is equal to (a times b)
  202. for all a and b.
  203.  
  204. LCM and GCD both complain if either of the supplied numbers is zero or
  205. negative or fractional. Both, also, always give out integer results.
  206. (No decimal places shown.)
  207.  
  208. The operators 'gcd' and 'lcm' are on a par with 'min' and 'max' in
  209. terms of priority - higher than addition or subtraction, but lower
  210. than multiplication or division or raising to powers.
  211.  
  212. e.g. '3*2 gcd 3*7', will give the answer '3', as the multiplication is
  213. performed first before the 'gcd'.
  214.  
  215. These operators are also associative, so you may obtain the LCM of x%,
  216. y% and z%, by typing 'x% lcm y% lcm z%' in the 'Input:' slot and
  217. clicking on 'Calculate'. If there is no operator of a higher
  218. priority,'lcm' and 'gcd' are obeyed from left to right.
  219.   
  220. Mathematical Functions
  221. =================
  222.  
  223. There are twenty one of these available, and if the arguments are out of
  224. range, !MFCalc complains. These functions need not have the
  225. input expression in brackets and bind more tightly than any of the
  226. operators. With trigonometric functions there are buttons on the
  227. 'SetUp' panel to select calculation in degrees, radians or grads.
  228.  
  229. 1. 'ABS' or 'abs' - Absolute postive value without the sign.
  230. 2. 'ACS' or 'acs' - Arccosine.
  231. 3. 'ASN' or 'asn' - Arcsine.
  232. 4. 'ATN' or 'atn' - Arctangent.
  233. 5. 'COS' or 'cos' - Cosine of the Angle given.
  234. 6. 'COSH' or 'cosh' - Hyperbolic cosine.
  235. 7. 'EXP' or 'exp' - Raising e to the given power.
  236. 8. 'FRAC' or 'frac' - Fractional part of the given number. Negative if
  237. the number is negative.
  238. 9. 'INT' or 'int' - Truncate to the integer below.
  239. 10. 'FIX' or 'fix' - Round to nearest integer. If negative, rounds down,
  240. if positive, rounds up.
  241. 11. 'LN' or 'ln' - Natural logarithm to base e.
  242. 12. 'LOG' or 'log' - Logarithm to base ten.
  243. 13. 'RND', 'rnd', "RAND", or "rand" - Gives out a random number
  244. in the range 0 - 1 (inclusive). Does not take in any value as an
  245. argument.
  246. 14. 'SGN' or 'sgn' - The 'sign' of the number, -1 if negative, 0 if
  247. zero, +1 if positive.
  248. 15. 'SIN' or 'sin' - Sine of supplied angle.
  249. 16. 'SINH' or 'sinh' - Hyperbolic sine.
  250. 17. 'SQR' or 'sqr' - Square root, complains if supplied number is
  251. negative. Additionally, 'SQRT' or 'sqrt' will also be accepted.
  252. 18. 'TAN' or 'tan' - Tangent of supplied angle.
  253. 19. 'TANH' or 'tanh' - Hyperbolic tangent.
  254. 20. 'CBR' or 'cbr' - Cube root, turns negative if supplied number is
  255. negative. Additionally, 'CBRT' or 'cbrt' will also be accepted.
  256. 21. 'LNFACT' or 'lnfact' - The natural logarithm of the factorial of
  257. the supplied argument. The factorial of a number is the product of
  258. the number with all the ones below it down to 1, so 3 factorial is
  259. 3.2.1=6 and 4 factorial is 4.3.2.1=24. The natural logarithm is taken
  260. because factorials grow large very quickly, so the logarithm slows
  261. this process down and stops numeric overflow at higher values. As
  262. with 'ncr', very large arguments cause a 'Stack Overflow' message.
  263.  
  264. In addition, the key word 'PI' or 'pi' in a calculation gives out the
  265. numeric value of the trigonometric constant pi.
  266.  
  267. All of these function names are reserved words and should not be used
  268. for variable names.
  269.  
  270. As already mentioned, these functions bind more tightly than any other
  271. operator, so, for example, the value of 'SIN 90 +2' is 3.0, not the
  272. Sine of 92, when in degree mode. Note that 'SIN' is separated from 90
  273. so that the reserved word 'SIN' can be recognised. If you had typed
  274. 'SIN90+2', a variable name 'SIN90' would be created, given a floating
  275. value of 0.0 and 2.0 added, so 2.0 would be output. Note, also, that
  276. if you had really wanted the Sine of 90+2, you should have used
  277. brackets and put 'SIN(90+2)'.
  278.  
  279. The Form of the Calculated Value
  280. ========================
  281.  
  282. The form (integer or floating point (double precision)) of the
  283. expression being calculated is always at the level of the highest
  284. operand, so, 2+3 gives an integer value of 5, and 5/2 gives an integer
  285. value of 2, but 2+3.0 gives a floating value of 5.0, and 5/2.0 gives a
  286. floating value of 2.5. If you had meant an integer divide to be
  287. performed, then you should have used 'DIV', i.e. '5 DIV 2.0' gives out
  288. an integer value of 2.
  289.  
  290. Getting back the Last Calculated Value
  291. ============================
  292.  
  293. The special variable 'ANS' or 'ans' is assigned the value of the last
  294. calculation. If this is an integer, ANS takes an integer value, if
  295. this is a floating value, ANS is floating, otherwise ANS starts with
  296. an integer value of 0. Like any other variable, ANS may be assigned a
  297. value. e.g. let ANS=2.5 , but it will not appear in the list produced
  298. by the LIST instruction (see below).
  299.  
  300. Declarations
  301. =========
  302.  
  303. Additionally you may declare variables to be integer or floating
  304. (double precision) using the key words 'INTEGER' or 'DOUBLE'
  305. respectively followed by a comma separated list of variable names of
  306. any type, either integer or float. You may also assign these variable
  307. names by using '='.
  308.  
  309. e.g.
  310.  
  311. INTEGER a, b, c=3
  312.  
  313. or
  314.  
  315. DOUBLE A%=1.2,D,e=2.71828
  316.  
  317. You may not concatenate these declarations.
  318.  
  319. PRIME Keyword
  320. =============
  321.  
  322. Prime numbers are not divisible by anything other than 1 and themselves.
  323. If a number is not prime, it can be represented as the product of
  324. primes and powers of primes less than itself, called factors. The
  325. number is said to be 'composite'.
  326.  
  327. 'PRIME' or 'prime' followed by any expression will determine if the
  328. integer produced is a prime number. Complains if the number is
  329. fractional. If the number is negative, the sign is removed before
  330. prime determination. If the number is floating point, it is
  331. integerised, but complains if the result would be too large for an
  332. integer. Indicates if the number is zero or +1 or -1 or even. This is
  333. done in integer arithmetic, so !MFCalc may crash if the number is
  334. too large.
  335.  
  336. Gives the smallest factor if the number is not prime.
  337.  
  338. e.g. 'PRIME 2^31-1' will produce the REM '/* 2147483647 is Prime */'.
  339.        'PRIME 13*17' will produce the REM '/* 221 is not Prime, Factor 13 */'.
  340.        
  341. 'PRIME' or 'prime' followed by an expression can also be put,
  342. separated by a colon, at the very end of a colon-separated list of
  343. assignments and 'input' statements (see below).
  344.  
  345. e.g. A 'Mersenne' prime is one of the form '2^n-1', so by repeating
  346. the line: 'input a%:prime 2^a%-1', using 'Entry Back' and 'Calculate',
  347. you may investigate for what values of a%, 2^a%-1 is prime.
  348.  
  349. Lastly, PRIME sets ANS to the value of the found lowest factor of the
  350. supplied expression, or to the value 1 if the expression is prime. So,
  351. for example, start with the line 'm%=1:ANS=1'. Then repeat the line:
  352.   'm%=m%*ANS:PRIME <expression>/m%', where <expression> is the
  353. expression you wish to factorise, and continue until you get a prime.
  354. You will then have found all the prime factors of <expression>.
  355.  
  356. Getting Rid of all the Variables
  357. =======================
  358.  
  359. The command 'CLEAR' or 'clear' will remove all the variables and start
  360. from scratch again.
  361.  
  362. Getting Rid of One Variable
  363. ====================
  364.  
  365. The command 'CLEAR' or 'clear' followed by the variable name will cause
  366. the variable to be removed from the list of defined variable names.
  367.  
  368. e.g. CLEAR a%
  369.  
  370. A message indicates if the variable name was already undefined.
  371.  
  372. Checking the Variables Present
  373. =======================
  374.  
  375. The single command 'LIST' or 'list' and clicking 'Calculate' will
  376. cause an alphabetical list of the variable names and values to appear
  377. in the Input Slot. After each line, press the Return (Enter) key and a
  378. new line appears, or a message indicating the end of the list.
  379. Pressing the Escape key at any time terminates the list and a message
  380. indicating that appears. A message also indicates when no variables
  381. have been defined. The list also shows if the variable has not been
  382. explicitly assigned a value. Also the form of representation of the
  383. assigned value in the list gives the variable's data type - it is
  384. represented as an integer without a decimal point if the variable is
  385. to be taken as holding an integer value - with a decimal point if it
  386. is a floating variable e.g. a variable with the a value of six would
  387. be listed with a value '6' if it was an integer variable, but '6.0' if
  388. it was a floating (double precision) variable.
  389.  
  390. The Field Length and Number of Decimal Places
  391. ===================================
  392.  
  393. Just type numeric values into the slots provided, then press
  394. the 'Enter' key (Return). !MFCalc requires that you press 'Enter'
  395. before these values are recognised. Clearing them out to nothing just
  396. leaves the values unaltered. !MFCalc complains if you try to make the
  397. field length less than the number of places, or the number of places
  398. more than the field length. Not available in hexadecimal or octal
  399. notation. Also the choice of representation in floating, exponential
  400. or general format is only available in decimal notation, not hex or
  401. octal.
  402.  
  403. The INPUT command
  404. ================
  405.  
  406. The key word 'INPUT' followed by a single variable name e.g. INPUT a%
  407. will cause a prompt REM of the form:- '/* Type a%, Enter or Escape */
  408. to appear in the 'Input:' slot together with a red caret. Typing the
  409. value at the caret and pressing 'Enter' ('Return') will assign the
  410. variable a% with the typed literal. Pressing the 'Escape' key at this
  411. point leaves the variable unassigned with its default value of zero.
  412.  
  413. Note that !MFCalc will only accept literals e.g. 123, 2.31, &123,
  414. &o127, 1E2, 0.5e-04 or a single variable name at the prompt, not whole
  415. expressions. The only exception is that you may put a minus '-' sign
  416. infront.
  417.  
  418. Also Note pressing the 'Backspace' or 'Delete' key, if you make a
  419. mistake, will erase the mistaken entry, and assign the variable the
  420. new value on pressing 'Enter' ('Return'). Pressing the 'Escape' key,
  421. as mentioned above, aborts the current INPUT statement. In this case,
  422. no new value is assigned. This is useful if you do not wish to alter
  423. the value of an INPUT variable. If you use the cursor keys to move
  424. backwards and forwards in the 'Input:' slot, they will have no effect.
  425.  
  426. Inherited Unassignment: If you use INPUT and enter an unassigned
  427. variable name at the prompt, then the INPUT variable remains
  428. unassigned.
  429.  
  430. INPUT statements can be concatenated, so, you may put e.g.
  431.  
  432. INPUT a%:INPUT b%:INPUT c%
  433.  
  434. And !MFCalc will prompt for the value a%, then b%, then c%
  435.  
  436. The INPUT statement allows you to give your own prompt by supplying a
  437. double quoted character string, which is converted to your own REM before
  438. the prompt caret e.g. 'INPUT "Give Value"; a%' will give:
  439. '/* Give Value */  followed by a prompt for the value. If you
  440. supply '/*' or '*/' in the quoted string, they are removed from the
  441. REM. If you require a double quote, supply "" within the string, which
  442. is converted to a " within your REM. The semi-colon afterwards, when
  443. supplied, suppresses a '?' from being added to the REM.
  444.  
  445. The PRINT Command
  446. ================
  447.  
  448. 'PRINT' followed by any expression simply gives the value of the
  449. expression when the 'Calculate' button is clicked on. The advantage is
  450. that this command can occur after a colon at the end of any series of
  451. assignments or INPUTs e.g.
  452.  
  453. 'INPUT a%:b%=1:INPUT c%:PRINT a%+b%+c%' will prompt for the values of
  454. a% and c% then give the value of a%+b%+c%. PRINT should only occur at
  455. the end of an 'Input:' line.
  456.  
  457. Similarly to INPUT, PRINT can be followed by a string of characters in
  458. double quotes before the expression. The string will be output as a
  459. comment before the value of the expression when 'Calculate' is clicked
  460. on. You may separate the string from the expression by a semi-colon,
  461. but it has no effect.
  462.  
  463. As described below, you may bring this line back and so perform a
  464. calculation many times over with different input values.
  465.  
  466. The 'Entry Back' and 'Entry Forward' Buttons
  467. =================================
  468.  
  469. Every time you click on 'Calculate', the 'Input:' slot value is stored
  470. away on a stack. The 'Entry Back' button, when clicked,
  471. successively brings back previous 'Input:' lines into the 'Input:'
  472. slot. There is enough storage to hold up to twenty previous lines.
  473. When this is exceeded, the 'stack' shifts up, so lines more than
  474. twenty ago are lost.
  475.  
  476. The 'Entry Forward' button moves forward in time right up to the
  477. current line, reversing the effect of 'Entry Back'.
  478.  
  479. Neither of these buttons have any effect until you have entered
  480. several lines.
  481.  
  482. If you go back to a previous line, then enter a different line and
  483. click on 'Calculate', then immediately the entries forward in time
  484. from the chosen line are lost, but those previous in time to the
  485. chosen line can still be obtained by clicking on the 'Entry Back'
  486. button.
  487.  
  488. 'Input:' Lines are not recorded in the memory stack if they are blank
  489. or they repeat the same calculation as the previous entry on the
  490. stack. This means you can repeat previous calculations without it
  491. affecting the previous line memory stack.
  492.  
  493. Lastly, the 'Clear Entries' button completely clears out the memory
  494. stack and all knowledge of any previous lines is lost. Remember to
  495. distinguish this from the 'Clear Entry' button, that just clears out
  496. the 'Input:' slot and has no effect on the memory stack.
  497.  
  498. The 'Save Entries' and 'Retrieve Entries' Buttons
  499. ===================================
  500.  
  501. The 'Save Entries' Button copies all the entries in the memory stack
  502. to an internal file, which can be brought back by clicking on the
  503. 'Retrieve Entries' Button, even after you have Quited the whole
  504. application. Both buttons give out a message indicating how many
  505. entries were Saved/Retrieved, but in the case of 'Retrieve Entries',
  506. Press the 'Enter' ('Return') key afterwards. The entry you will then
  507. see in the 'Input:' slot is the last one you were looking at when you
  508. Saved the Entries.
  509.  
  510. If you have a constant set of calculations you perform, this saves
  511. having to type them in time and again.
  512.  
  513. Getting Out of the Application
  514. ======================
  515.  
  516. You may select 'Quit' from both the icon bar menu and the 'Help' menu
  517. to terminate the application. Selecting the 'Close' icon on the
  518. 'SetUp' panel simply removes the panel and does not clear any of the
  519. variable names, but typing 'QUIT' or 'quit' in the 'Input' slot and
  520. clicking 'Calculate' both removes the panel and clears the variable
  521. names. Lastly, typing 'EXIT' or 'exit' and clicking 'Calculate'
  522. completely terminates the application. In certain circumstances, the
  523. 'Escape' key has the same effect as 'QUIT'.
  524.  
  525. Bugs
  526. ====
  527.  
  528. 1. It has been discovered that the value returned for the Sine of 90
  529. degrees is marginally greater than one, so if you immediately perform
  530. an Arc Sine on this value, !MFCalc objects to the number input to Arc
  531. Sine being greater than one. i.e. ASN SIN 90 in degree mode produces
  532. an error message, not a return value of 90. The same is true of SIN -90.
  533. The same is not true of the COS of zero.
  534.  
  535. 2. If the resulting value of integer arithmetic with '+', '-', '*' or
  536. '^' overflows the 32 bits used for its (signed) representation, then
  537. the calculation is converted to a floating one. The same is not true
  538. for floating calculations. If you wish to calculate with large
  539. numbers, then you could use floating arithmetic e.g. represent one
  540. hundred million as '100000000.0'. However, if any integer literal in a
  541. calculation exceeds about 8 digits, it is automatically converted so
  542. as to be taken as floating literal and the whole calculation is
  543. performed as a floating one anyway.
  544.  
  545. Integer '/', MOD or DIV are calculated in integer storage. If the
  546. numbers involved are large (roughly over 8 digits), it can cause
  547. integer overflow and !MFCalc crashes.
  548.  
  549. Also realise that even if the calculation is done in floating point
  550. format, because of the way the number is stored, only 16 - 17
  551. significant digits can be held. If, for example, the result of the
  552. calculation exceeds 10^17, then only the first 16 - 17 digits will
  553. appear before the decimal point, the rest being zero.
  554.  
  555. 3. For various reasons, it is best to perform repeated raising to
  556. powers (using '^') as all integer as all float (not mixed arithmetic).
  557.  
  558. e.g. 3 ^ 2 ^ 2 or 3.0 ^ 2.0 ^ 2.0, but not 3 ^ 2.0 ^ 2.0
  559.  
  560. However, with a single '^', any mixture of integer or float is
  561. acceptable. As mentioned above, if the two operands are integer, the
  562. result is an integer, but otherwise the result is floating.
  563.  
  564. Also beware of large numeric values (overflow) developing during
  565. repeated exponentiation. It can produce very odd output results,
  566. particularly when displaying in 'Floating' mode.
  567.  
  568.  
  569. Reserved Words
  570. ============
  571.  
  572. A list of the reserved words (both in upper and lower case) used by
  573. !MFCalc follow. They should not be used as variable names. If you get
  574. an odd result or a syntax error, then you are probably using a
  575. reserved word in the wrong place, or think you are using one when
  576. you have typed it incorrectly or not separated it properly from other
  577. alphanumerics. Note the reserved words are either all upper case or
  578. all lower case and not any mixture:-
  579.  
  580. "ABS",
  581. "ACS",
  582. "ANS",
  583. "ASN",
  584. "ATN",
  585. "CBR",
  586. "CBRT",
  587. "CLEAR",
  588. "COS",
  589. "COSH",
  590. "DIV",
  591. "DOUBLE",
  592. "EXIT",
  593. "EXP",
  594. "FIX",
  595. "FRAC",
  596. "GCD",
  597. "INPUT",
  598. "INT",
  599. "INTEGER",
  600. "LCM",
  601. "LET",
  602. "LIST",
  603. "LN",
  604. "LNFACT",
  605. "LOG",
  606. "MAX",
  607. "MIN",
  608. "MOD",
  609. "NCR",
  610. "PI",
  611. "PRIME",
  612. "PRINT",
  613. "QUIT",
  614. "RAND",
  615. "REM",
  616. "RND",
  617. "SGN",
  618. "SIN",
  619. "SINH",
  620. "SQR",
  621. "SQRT",
  622. "TAN",
  623. "TANH",
  624. "abs",
  625. "acs",
  626. "ans",
  627. "asn",
  628. "atn",
  629. "cbr",
  630. "cbrt",
  631. "clear",
  632. "cos",
  633. "cosh",
  634. "div",
  635. "double",
  636. "exit",
  637. "exp",
  638. "fix",
  639. "frac",
  640. "gcd",
  641. "input",
  642. "int",
  643. "integer",
  644. "lcm",
  645. "let",
  646. "list",
  647. "ln",
  648. "lnfact",
  649. "log",
  650. "max",
  651. "min",
  652. "mod",
  653. "ncr",
  654. "pi",
  655. "prime",
  656. "print",
  657. "quit",
  658. "rand",
  659. "rem",
  660. "rnd",
  661. "sgn",
  662. "sin",
  663. "sinh",
  664. "sqr",
  665. "sqrt",
  666. "tan",
  667. "tanh".
  668.  
  669. Eighty eight reserved words in all, forty four in lower and forty four in upper case.
  670.  
  671. Have fun!
  672.  
  673. Queries, curses, praise to:-
  674.                                   
  675.       Martin Carradus,
  676.       Leaf Mindcraft,
  677.       c/o 27 Wells Road,
  678.       Ilkley,
  679.       West Yorkshire,
  680.       LS29 9JE.
  681.       U.K.
  682.  
  683. Send s.a.e. if you require a reply.
  684.  
  685. NB. Please read the Text file !ReadMe within this application for conditions of use.
  686. (Hold down 'Shift' and double click with the Mouse over the !MFCalc icon to find it.)
  687.  
  688. Martin Carradus July 2004.
  689.  
  690. Salutations.
  691.